home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / strategy / xshisen-.001 / xshisen-~ / xshisen-1.35 / actions.C next >
C/C++ Source or Header  |  1995-10-18  |  1KB  |  45 lines

  1. #include "body.h"
  2.  
  3. void
  4. PickupPieceAC(Widget w, XEvent *event, String *params, Cardinal *num)
  5. {
  6.     XButtonEvent *e = &(event->xbutton);
  7.     if (e->type != ButtonPress) return;
  8.     bd->GetPiece(e->x, e->y);
  9. #if DEBUG
  10.     fprintf(stderr, "PickupPieceAC: (%d,%d) %d\n", e->x, e->y, e->button);
  11. #endif
  12. }
  13.  
  14. void
  15. CancelPieceAC(Widget w, XEvent *event, String *params, Cardinal *num)
  16. {
  17.     XButtonEvent *e = &(event->xbutton);
  18.     if (e->type != ButtonPress) return;
  19.     bd->CancelPiece(e->x, e->y);
  20. #if DEBUG
  21.     fprintf(stderr, "CancelPieceAC: (%d,%d) %d\n", e->x, e->y, e->button);
  22. #endif
  23. }
  24.  
  25. void
  26. MenuAC(Widget w, XEvent *event, String *params, Cardinal *num)
  27. {
  28. #if DEBUG
  29.     fprintf(stderr, "MenuAC: (%d,%d)\n",atoi(params[0]),atoi(params[1]));
  30. #endif
  31.     if (*num < 2)
  32.         GameCB(w, 4);
  33.     switch(params[0][0]) {
  34.     case '0':
  35.         GameCB(w, atoi(params[1]));
  36.         break;
  37.     case '1':
  38.         SuppCB(w, atoi(params[1]));
  39.         break;
  40.     case '2':
  41.         ChangeGameCB(w, atoi(params[1]), NULL);
  42.         break;
  43.     }
  44. }
  45.